/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jam.sfcc.business;

import jam.sfcc.common.data.CajaData;
import jam.sfcc.common.domain.Caja;
import jam.sfcc.common.domain.Vendedor;
import java.sql.SQLException;

/**
 *
 * @author Josue
 */
public class CajaBusiness {

    private CajaData cajaData;

    public CajaBusiness(String userName, String password) {
        cajaData = new CajaData(userName, password);
    }

    public Caja getCierreDeCajaAnterior() throws SQLException {
        return cajaData.getCierreDeCajaAnterior();
    }

    public void abrirCaja(float montoInicial, Vendedor vendedor) throws SQLException {
        cajaData.abrirCaja(montoInicial, vendedor);
    }

    public void cerrarCaja(Caja caja) throws SQLException {
        cajaData.cerrarCaja(caja);
    }

    public Caja calcularCaja(int idVendedor) throws SQLException {
        return cajaData.calcularCaja(idVendedor);
    }
}
